<html>
<head>
<script type='text/javascript'>
/*@cc_on @if (@_win32 && @_jscript_version >= 5) if (!window.XMLHttpRequest)
window.XMLHttpRequest = function() { return new ActiveXObject('Microsoft.XMLHTTP') }
@end @*/

function xhr(method, url, data, cb, apply_para) {
  method = method.toLowerCase();
  var req;
  req = new XMLHttpRequest();
  req.open(method, url + (data && method == 'get' ? '?' + data : ''), true);
  req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  if (method == 'post') {
      req.setRequestHeader("Method", "POST " + url + " HTTP/1.1");
      req.setRequestHeader("Content-Length", data.length);
  }
  req.onreadystatechange = function() {
      if (req.readyState == 4 && req.status == 200) {
              if (cb) {
              cb.apply(null, [req].concat(apply_para));
          }
      }
  }
  req.send(data);
}
function makerequest(){
	xhr('get','translate_dict_cc.php?s='+document.translateform.query.value,null,callback);
}
function callback(req){
	document.getElementById('data').innerHTML = req.responseText;
}
</script>
<body>
	<div id="data">Daten</div>
	<form name='translateform'>
		<input type='text' name='query' />
		<input type="button" name='translate' value='translate!' onclick='makerequest()' onkeypress='makerequest();' />
	</form>
	
</body>